import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { AppmenutypeVO, AppmenutypeForm, AppmenutypeQuery } from '@/api/system/appMenuType/types';

/**
 * 查询移动端应用菜单分类列表
 * @param query
 * @returns {*}
 */

export const listAppmenutype = (query?: AppmenutypeQuery): AxiosPromise<AppmenutypeVO[]> => {
  return request({
    url: '/system/appMenuType/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询移动端应用菜单分类详细
 * @param appMenuTypeId
 */
export const getAppmenutype = (appMenuTypeId: string | number): AxiosPromise<AppmenutypeVO> => {
  return request({
    url: '/system/appMenuType/' + appMenuTypeId,
    method: 'get'
  });
};

/**
 * 新增移动端应用菜单分类
 * @param data
 */
export const addAppmenutype = (data: AppmenutypeForm) => {
  return request({
    url: '/system/appMenuType',
    method: 'post',
    data: data
  });
};

/**
 * 修改移动端应用菜单分类
 * @param data
 */
export const updateAppmenutype = (data: AppmenutypeForm) => {
  return request({
    url: '/system/appMenuType',
    method: 'put',
    data: data
  });
};

/**
 * 删除移动端应用菜单分类
 * @param appMenuTypeId
 */
export const delAppmenutype = (appMenuTypeId: string | number | Array<string | number>) => {
  return request({
    url: '/system/appMenuType/' + appMenuTypeId,
    method: 'delete'
  });
};
